package com.itheima.stock.service.impl;

import com.itheima.stock.entity.StockBusiness;
import com.itheima.stock.mapper.StockBusinessMapper;
import com.itheima.stock.response.ResponseResult;
import com.itheima.stock.service.StockService;
import groovy.transform.AutoFinal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StockServiceImpl implements StockService {
    private final StockBusinessMapper stockBusinessMapper;

    public StockServiceImpl(StockBusinessMapper stockBusinessMapper) {
        this.stockBusinessMapper = stockBusinessMapper;
    }

    @Override
    public ResponseResult<List<StockBusiness>> getStockBusiness() {
        List<StockBusiness> stockBusinessList = stockBusinessMapper.selectAll();
        return ResponseResult.ok(stockBusinessList);
    }
}
